#!/usr/bin/env python
PACKAGE = "mrs_uav_trajectory_generation"

import roslib;
roslib.load_manifest(PACKAGE)

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

general = gen.add_group("General");

method_enum = gen.enum([gen.const("kSquaredTime", int_t, 0, "kSquaredTime"),
                           gen.const("kRichterTime", int_t, 1, "kRichterTime"),
                           gen.const("kMellingerOuterLoop", int_t, 2, "kMellingerOuterLoop"),
                           gen.const("kSquaredTimeAndConstraints", int_t, 3, "kSquaredTimeAndConstraints"),
                           gen.const("kRichterTimeAndConstraints", int_t, 4, "kRichterTimeAndConstraints")],
                           "Direction")

derivative_enum = gen.enum([gen.const("acc", int_t, 0, "acc"),
                           gen.const("jerk", int_t, 1, "jerk"),
                           gen.const("snap", int_t, 2, "snap")],
                           "Derivative to optimize")

general.add("enforce_fallback_solver", bool_t, 0, "Enforce Fallback", False)
general.add("time_penalty", double_t, 0, "Time penalty", 500.0, 0.0, 1000000.0)
general.add("time_allocation", int_t, 0, "Time allocation", 0, 0, 4, edit_method=method_enum)
general.add("derivative_to_optimize", int_t, 0, "Derivative to optimize", 0, 0, 2, edit_method=derivative_enum)
general.add("inequality_constraint_tolerance", double_t, 0, "Ineq. const. tolerance", 0.0, 0.0, 1000000.0)
general.add("equality_constraint_tolerance", double_t, 0, "Eq. const. tolerance", 0.0, 0.0, 1000000.0)
general.add("max_iterations", int_t, 0, "Max iter.", 0, 0, 1000000)
general.add("max_execution_time", double_t, 0, "Max execution time", 0, 0, 10.0)
general.add("max_deviation", double_t, 0, "Max deviation", 0, 0, 100.0)

soft = gen.add_group("Soft constraints");

soft.add("soft_constraints_enabled", bool_t, 0, "Enabled", True)
soft.add("soft_constraints_weight", double_t, 0, "Weight", 0.0, 0.0, 1000000.0)

exit(gen.generate(PACKAGE, "MrsTrajectoryGeneration", "drs"))
